<extend name="Public/layout"/>

<block name="style">
    <style type="text/css">
        @media (min-width: 992px) {
            .form select,
            .form textarea,
            .form input[type=text],
            .form input[type=password],
            .form .token-input-list{
                width: 50% !important;
                max-width: 600px;
            }
        }
    </style>
</block>

<block name="body">
    <div class="row">
        <div class="col-xs-12">
            <form action="__SELF__" method="post" class="form">
                <div class="tab-content">
                    <div class="blank"></div>
                    <div id="tab1" class='tab-pane active'>
                        <div class="form-group">
                            <label class="item-label">上级菜单<span class="check-tips">（所属的上级菜单）</span></label>
                            <div class="controls">
                                <select name="pid" class="form-control">
                                    <volist name="all_group" id="group">
                                        <option value="{$group.id}" 
                                    <php>if($group['id'] == $info['pid']) echo 'selected="selected"';</php> >
                                    {$group.title}
                                    </option>
                                </volist>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="item-label">菜单名称<span class="check-tips">（菜单名称）</span></label>
                        <div class="controls">
                            <input type="text" class="form-control" name="title" value="{$info.title|default=''}">
                        </div>
                    </div>
                    <div id="tab1" class='tab-pane active'>
                        <div class="form-group">
                            <label class="item-label">类型<span class="check-tips">（选择跳转URL时请在关键字字段中填写URL）</span></label>
                            <div class="controls">
                                <select name="type" class="form-control">
                                    <for start="0" end="count($event_type)">
                                        <option value="{$event_type.$i}" <if condition="$event_type[$i] eq $info['type']">selected="selected" </if>>{$event_type_title.$i} </option>
                                    </for>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="item-label">关键字<span class="check-tips">（关键字）</span></label>
                            <div class="controls">
                                <input type="text" class="form-control" name="keyword" value="{$info.keyword|default=''}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="item-label">排序<span class="check-tips">（用于菜单显示的顺序）</span></label>
                            <div class="controls">
                                <input type="text" class="form-control" name="sort" value="{$info.sort|default=0}">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <input type="hidden" name="id" value="{$info.id|default=''}">
                    <button class="btn btn-primary submit ajax-post" type="submit" target-form="form">确 定</button>
                    <button class="btn return" onclick="javascript:history.back(-1);
                            return false;">返 回</button>
                </div>
        </form>
    </div>
</div>
</block>

